// 1-3-4-1.cpp
#include <iostream>
using namespace std;

int main()
{
    int num;
    cin >> num;

    // We can print the number one by one
    cout << num % 10;
    cout << (num / 10) % 10;    // (num % 100) / 100
    cout << (num / 100) % 10;   // (num % 1000) / 100
    cout << num / 1000 << endl;
    return 0;
}
